//输入项查询组件
// import { Row, Col, Input, Button, Form } from "antd"
import { Input, Button, Form } from "antd"



const FormItem = Form.Item

const SearchForm = ({
    searchFun,
    form: {   // 被 Form.create()(SearchWrap) 包裹的组件会有antd提供的form属性
        getFieldDecorator, //用于和表单进行双向绑定
        getFieldsValue,    //获取一组输入控件的值，如不传入参数，则获取全部组件的值
    },
}) => {

    const searchHandle = () => {
        let fields = getFieldsValue()
        searchFun(fields)  //父组件中定义
    }

    return (
        <Form>
         
            {/* <Row gutter={8} justify="space-between" >
                <Col style={{ float: "left", width: 256 }}> */}
                    <FormItem style={{ height: 20 }}>
                        {getFieldDecorator('code')(
                            <Input style={{ float: "left", width: 256 }} placeholder="状态码：输入状态码查询" />
                        )}
                        <Button type="primary" style={{ float: "left", marginLeft: 5 }} onClick={searchHandle}>搜索</Button>
                    </FormItem>
                {/* </Col>
                <Col style={{ float: "left" }}>
                    <FormItem> */}
                        
                    {/* </FormItem> */}
                {/* // </Col> */}
            {/* // </Row> */}
    
        </Form>
    )
}

export default Form.create()(SearchForm)